* Final Do file for manuscript "How social capital matters for receiving social support: On the complementary role of civil society in the Covid-19 pandemic"



use "", clear
set more off
set scheme modern

*Set pweight*
svyset [pweight=wgt_2], strata(cntry)


*****CODING OF DEPENDENT VARIABLES*********

* DV 1
* "Received support": 0= no help; 1= seldom, sometimes, often, very often
gen gethelp_2=0
replace gethelp_2=1 if gethelp==2|gethelp==3|gethelp==4|gethelp==5
label define gethelp_bi 1 "Received support" 0 "No support", replace
label values gethelp_2 gethelp_bi

* DV 2
*Binary: Needed more suppor*
gen gethelp_more_bi=0
replace gethelp_more_bi=1 if gethelp_more>2
label define gethelp_more_bi 1 "Needed more support" 0 "Did not need more support", replace
label values gethelp_more_bi gethelp_more_bi

*Define 0 = Received support for subset regressions // setting reference group = sufficient support  
gen gethelp_more_bi_3=0 if gethelp>1
replace gethelp_more_bi_3=1 if gethelp>1 & gethelp_more_bi==1


* Recoding of gethelp_more (DV2) for ordered logit so that reference group is same as in Table 2
gen needed_more=0 if gethelp>1
replace needed_more=1 if gethelp_more==2 & gethelp> 1
replace needed_more=2 if gethelp_more==3 & gethelp> 1
replace needed_more=3 if gethelp_more==4 & gethelp> 1



*Defining helper groups: 

gen gethelp_famfriends_r=0
replace gethelp_famfriends_r=1 if (gethelp_famfriends==1 & gethelp>1)

gen gethelp_neighbor_r=0
replace gethelp_neighbor_r=1 if (gethelp_neighbor==1 & gethelp>1)

gen gethelp_unknown_r=0
replace gethelp_unknown_r=1 if (gethelp_unknown==1 & gethelp>1)

gen gethelp_orga_r=0
replace gethelp_orga_r=1 if (gethelp_orga==1 & gethelp>1)

gen gethelp_general_r=0
replace gethelp_general_r=1 if (gethelp_general==1 & gethelp>1)

gen gethelp_emo_r=0
replace gethelp_emo_r=1 if (gethelp_emo==1 & gethelp>1)

gen gethelp_fin_r=0
replace gethelp_fin_r=1 if (gethelp_fin==1 & gethelp>1)

gen gethelp_civilsociety=0
replace gethelp_civilsociety=1 if gethelp>1 & (gethelp_unknown==1|gethelp_orga==1) 


// Redefining helper groups for regressions / for subset analyses in Table 2
// Setting 0 = only those who received any form of help 

gen gethelp_famfriends_2=0 if gethelp>1
replace gethelp_famfriends_2=1 if gethelp_famfriends==1 & gethelp>1

gen gethelp_neighbor_2=0 if gethelp>1
replace gethelp_neighbor_2=1 if gethelp_neighbor==1 & gethelp>1

gen gethelp_civsoc_2=0 if gethelp>1
replace gethelp_civsoc_2=1 if (gethelp_unknown==1|gethelp_orga==1) & gethelp>1

gen gethelp_unknown_2=0 if gethelp>1
replace gethelp_unknown_2=1 if gethelp_unknown==1 & gethelp>1

gen gethelp_orga_2=0 if gethelp>1
replace gethelp_orga_2=1 if gethelp_orga==1 & gethelp>1


// Defining mutually exclusive helper groups for subset analyses in Table 3 

*1) Family & Friends ONLY; 
*2) Family, friends PLUS NEIGHBORS; 
*3) All three groups: FF + Neighbors + Civil society actors

gen ffonly=0 if gethelp>1 
replace ffonly=1 if gethelp>1 & gethelp_famfriends==1 & gethelp_neighbor==0 & gethelp_unknown==0 & gethelp_orga==0

gen ffandneighbors=0 if gethelp>1 
replace ffandneighbors=1 if gethelp>1 & gethelp_famfriends==1 & gethelp_neighbor==1 & gethelp_unknown==0 & gethelp_orga==0

gen all=0 if gethelp>1 
replace all=1 if gethelp>1 & gethelp_famfriends==1 & gethelp_neighbor==1 & (gethelp_unknown==1|gethelp_orga==1)


*Helper groups variable with mutually exclusive categories 
gen helper_groups=1 if ffonly==1
replace helper_groups=2 if ffandneighbors==1
replace helper_groups=3 if all==1
label define helper_groups 1 "Family & Friends only" 2 "Family, Friends, Neighbors" 3 "All three groups (Family & Friends, Neighbors, Civil Society)", replace
label values helper_groups helper_groups

** WITH EVERYONE WHO RECEIVES SUPPORT AS BASIS 
gen helper_groups_2=0 if gethelp>1
replace helper_groups_2=1 if ffonly==1
replace helper_groups_2=2 if ffandneighbors==1
replace helper_groups_2=3 if all==1
label define helper_groups_2 1 "Family & Friends only" 2 "Family, Friends, Neighbors" 3 "All three groups (Family & Friends, Neighbors, Civil Society)", replace
label values helper_groups_2 helper_groups_2




*recoding INDEPENDENT VARIABLES 

rename friends social_circle
* social_circle & trust_people are used in their original form 

*Member of an organization*
gen member=0
replace member=1 if orga_labour==1|orga_party==1|orga_religious==1| orga_sports==1| orga_arts==1| orga_environment==1| orga_neighbor==1| orga_humanrights==1| orga_welfare==1| orga_patriotic==1| orga_others==1
label define member 1 "Member in an organisation" 0 "not a member"
label values member member


* Standardization of social_circle & trust_people
egen zsocial_circle = std(social_circle)
egen ztrust_people = std(trust_people)
fre zsocial_circle
fre ztrust_people


* recoding CONTROL VARIABLES 

*Binary var for Infection*
gen infection=.
replace infection=1 if inf_me==1|inf_household==1
replace infection=0 if infection==.
label define infection 1 "Infection (self or household)" 0 "No infection", replace
label values infection infection

* Label 
label define home_child 1 "Child at home" 0 "No child", replace
label values home_child home_child

label define home_office 1 "Home office" 0 "No home office", replace
label values home_office home_office

label define home_care 1 "Care responsibility at home" 0 "No care", replace
label values home_care home_care


*Recode state_spprt for regressions*
gen state_spprt_r=.
replace state_spprt_r=1 if state_spprt==3
replace state_spprt_r=2 if state_spprt==1
replace state_spprt_r=3 if state_spprt==2
replace state_spprt_r=4 if state_spprt==4
label define state_spprt_r 1 "Not needed" 2 "Received,adequate" 3 "Received, insufficient" 4 "Not received, but needed", replace
label values state_spprt_r state_spprt_r

*Recode binary state support*
gen state_spprt_bi=0
replace state_spprt_bi=1 if state_spprt==1|state_spprt==2
label define state_spprt_bi 1 "Received state support" 0 "Did not receive state support" 
label values state_spprt_bi state_spprt_bi

*Recode income_chng for regressions*
gen income_chng_r=.
replace income_chng_r=1 if income_chng==3|income_chng==4|income_chng==5
replace income_chng_r=2 if income_chng==1|income_chng==2
label define income_chng_r 1 "Positive or no change" 2 "Negative change", replace
label values income_chng_r income_chng_r

*Recode income for regressions*
gen income_r=.
replace income_r=1 if income==1|income==2
replace income_r=2 if income==3|income==4
label define income_r 1 "Living comfortably/ Coping" 2 "Finding it difficult" 
label values income_r income_r

*** Needed state support, but did not receive any****
gen needed_state=0
replace needed_state=1 if state_spprt==4



**Big Five// for robustness tests 

*Conscientiousness :
*perso_exact perso_lazy perso_effic
*reverse code: perso_lazy
gen perso_lazy_r=.
replace perso_lazy_r=1 if perso_lazy==7
replace perso_lazy_r=2 if perso_lazy==6
replace perso_lazy_r=3 if perso_lazy==5
replace perso_lazy_r=4 if perso_lazy==4
replace perso_lazy_r=5 if perso_lazy==3
replace perso_lazy_r=6 if perso_lazy==2
replace perso_lazy_r=7 if perso_lazy==1
label define perso_lazy_r 1 "Applies completely" 7 "Does not apply at all" 
label values perso_lazy_r perso_lazy_r
egen Gewissenhaftigkeit = rmean (perso_exact perso_lazy_r perso_effic)

*Extraversion:
*perso_comm perso_soc perso_restrained
*reverse code: perso_restrained
gen perso_restrained_r=.
replace perso_restrained_r=1 if perso_restrained==7
replace perso_restrained_r=2 if perso_restrained==6
replace perso_restrained_r=3 if perso_restrained==5
replace perso_restrained_r=4 if perso_restrained==4
replace perso_restrained_r=5 if perso_restrained==3
replace perso_restrained_r=6 if perso_restrained==2
replace perso_restrained_r=7 if perso_restrained==1
label define perso_restrained_r 1 "Applies completely" 7 "Does not apply at all" 
label values perso_restrained_r perso_restrained_r
egen Extraversion = rmean (perso_comm perso_soc perso_restrained_r)

*Agreeableness:
*perso_rough perso_forgive perso_friendly
*reverse code: perso_rough

gen perso_rough_r=.
replace perso_rough_r=1 if perso_rough==7
replace perso_rough_r=2 if perso_rough==6
replace perso_rough_r=3 if perso_rough==5
replace perso_rough_r=4 if perso_rough==4
replace perso_rough_r=5 if perso_rough==3
replace perso_rough_r=6 if perso_rough==2
replace perso_rough_r=7 if perso_rough==1
label define perso_rough_r 1 "Applies completely" 7 "Does not apply at all" 
label values perso_rough_r perso_rough_r
egen Verträglichkeit = rmean (perso_rough_r perso_forgive perso_friendly)

*Openness to experience:
*perso_orig perso_aest perso_imag

egen Offenheit = rmean (perso_orig perso_aest perso_imag)

*Neuroticism 
*perso_worr perso_nerv perso_relax
*reverse code: perso_worr & perso_nerv
gen perso_worr_r=. 
replace perso_worr_r=1 if perso_worr==7
replace perso_worr_r=2 if perso_worr==6
replace perso_worr_r=3 if perso_worr==5
replace perso_worr_r=4 if perso_worr==4
replace perso_worr_r=5 if perso_worr==3
replace perso_worr_r=6 if perso_worr==2
replace perso_worr_r=7 if perso_worr==1
label define perso_worr_r 1 "Applies completely" 7 "Does not apply at all" 
label values perso_worr_r perso_worr_r

gen perso_nerv_r=. 
replace perso_nerv_r=1 if perso_nerv==7
replace perso_nerv_r=2 if perso_nerv==6
replace perso_nerv_r=3 if perso_nerv==5
replace perso_nerv_r=4 if perso_nerv==4
replace perso_nerv_r=5 if perso_nerv==3
replace perso_nerv_r=6 if perso_nerv==2
replace perso_nerv_r=7 if perso_nerv==1
label define perso_nerv_r 1 "Applies completely" 7 "Does not apply at all" 
label values perso_nerv_r perso_nerv_r

egen EmoStab = rmean (perso_worr_r perso_nerv_r perso_relax)




***********************************
* FIGURES IN TEXT 
***********************************

************
* Figure 1: Venn Diagram 
************

ssc install pvenn

svy: tab gethelp_famfriends_r
* 37% receive help from fam + friends 
svy: tab gethelp_neighbor_r
* 18% receive help from neighbors
svy: tab gethelp_civilsociety
* 9% receive help from civil society 

* Label circles manually with values from svy: tab above
pvenn gethelp_famfriends_r gethelp_neighbor_r gethelp_civilsociety, legend(pos(6)) legend(rows(1)) note(n=3330)



*** Main effect of social capital on "received social support" overall  // margins for substantive effect sizes in text 

logistic gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post
coefplot, xline(0) levels(95) xlabel(, labsize(medsmall)) xtitle(Marginal effect on 'received support') ylabel(, labsize(small) val) title("Social Capital") keep(social_circle *.member trust_people) scheme(plotplainblind)  coeflabels(social_circle = "Size of support network" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(n=3330)


************
* Figure 2: Marginal effects plot of social capital vars // based on Table 2 in Appendix 1 
************

logistic gethelp_famfriends_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store ff
logistic gethelp_neighbor_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store neighbor
logistic gethelp_civsoc_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store civsoc
coefplot ff neighbor civsoc, xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) xtitle(Marginal effect on receiving support) keep(social_circle *.member trust_people) scheme(plotplainblind)  coeflabels(social_circle = "Size of support network" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(n=1476) 



************
* Figure 3: Marginal effects plot for mutually exclusive helper groups // based on Table 4 in Appendix 1
************

logistic ffonly i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store ffonly
logistic ffandneighbors i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store ff_neighbor
logistic all i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store all
margins, dydx(_all) post
estimates store all_three
coefplot ffonly ff_neighbor all_three, legend(pos(6) col(1)) xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) xtitle(Marginal effect on receiving support) keep(social_circle *.member trust_people) scheme(plotplainblind)  coeflabels(social_circle = "Size of support network" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(N=1476)


************
* Figure 4: Marginal effects plot for receiving insufficient support / effect of different helper groups  
************

* final version in text 
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety) post
estimates store groups
coefplot groups, xline(0) xtitle(Marginal effect of receiving 'insufficient support', size(small)) note(n=1476) coeflabels(1.gethelp_famfriends_r = "Support from family & friends" 1.gethelp_neighbor_r = "Support from neighbours" 1.gethelp_civilsociety= "Support from civil society")


************
* Figure 5:  Pandemic burdens by helper groups // Which helper groups are most present?
************
gen infection_sh=infection*100
gen home_office_sh=home_office*100
gen home_child_sh=home_child*100
gen home_care_sh=home_care*100
gen helper_groups_sh=helper_groups*100

* 22% home office 
svy: tab home_office
* 5% Infection 
svy: tab infection
* 17% Child at home 
svy: tab home_child
* 6% care resp. 
svy: tab home_care

tab helper_groups home_office, col nof
tab helper_groups infection, col nof
tab helper_groups home_child, col nof
tab helper_groups home_care, col nof


* Home_office 
preserve
collapse (mean) meanoffice=home_office_sh (sd) sdoffice=home_office_sh (count) n=home_office_sh, by(helper_groups)
generate hioffice = meanoffice + invttail(n-1,0.025)*(sdoffice / sqrt(n))
generate looffice = meanoffice - invttail(n-1,0.025)*(sdoffice / sqrt(n))

twoway (bar meanoffice helper_groups if helper_groups==1) ///
       (bar meanoffice helper_groups if helper_groups==2) ///
       (bar meanoffice helper_groups if helper_groups==3) ///
	   (function y = 22, ra(0 3.5)) ///
       (rcap hioffice looffice helper_groups), legend(off) xlabel( 1 `" "Family & Friends" "only""' 2 `"+ neighbors"' 3 `"+ civil society"',labsize(small) noticks) ///
		title(Home office) xtitle("") ytitle("Share of ppl. in home office") scheme(lean2) name(A1, replace)
restore


*infection
preserve
collapse (mean) meaninfection=infection_sh (sd) sdinfection=infection_sh (count) n=infection_sh, by(helper_groups)
generate hiinfection = meaninfection + invttail(n-1,0.025)*(sdinfection / sqrt(n))
generate loinfection = meaninfection - invttail(n-1,0.025)*(sdinfection / sqrt(n))

twoway (bar meaninfection helper_groups if helper_groups==1) ///
       (bar meaninfection helper_groups if helper_groups==2) ///
       (bar meaninfection helper_groups if helper_groups==3) ///
	   (function y = 5, ra(0 3.5)) ///
       (rcap hiinfection loinfection helper_groups), legend(off) xlabel( 1 `" "Family & Friends" "only""' 2 `" + neighbors"' 3 `"+ civil society"',labsize(small) noticks) ///
       xtitle("Helper Groups") ytitle("Share of ppl. w. infection") xtitle("") title(Infection in household) scheme(lean2) name(A2, replace)
restore 
	   
*Child at home 
preserve
collapse (mean) meanhome_child=home_child_sh (sd) sdhome_child =home_child_sh (count) n=home_child_sh, by(helper_groups)
generate hihome_child = meanhome_child + invttail(n-1,0.025)*(sdhome_child  / sqrt(n))
generate lohome_child  = meanhome_child  - invttail(n-1,0.025)*(sdhome_child  / sqrt(n))

twoway (bar meanhome_child helper_groups if helper_groups==1) ///
       (bar meanhome_child helper_groups if helper_groups==2) ///
       (bar meanhome_child helper_groups if helper_groups==3) ///
	   (function y = 17, ra(0 3.5)) ///
       (rcap hihome_child lohome_child helper_groups), ///
       legend(off) xlabel( 1 `" "Family & Friends" "only""' 2 `"+ neighbors"' 3 `" + civil society"', labsize(small) noticks) ///
       xtitle("Helper Groups") ytitle("Share of ppl. w. child at home") xtitle("") title(Child at home) scheme(lean2) name(A3, replace)
restore

*Care responsibility 
preserve
collapse (mean) meanhome_care=home_care_sh (sd) sdhome_care =home_care_sh (count) n=home_care_sh, by(helper_groups)
generate hihome_care = meanhome_care + invttail(n-1,0.025)*(sdhome_care  / sqrt(n))
generate lohome_care  = meanhome_care  - invttail(n-1,0.025)*(sdhome_care / sqrt(n))

twoway (bar meanhome_care helper_groups if helper_groups==1) ///
       (bar meanhome_care helper_groups if helper_groups==2) ///
       (bar meanhome_care helper_groups if helper_groups==3) ///
	   (function y = 6, ra(0 3.5)) ///
       (rcap hihome_care lohome_care helper_groups), ///
       legend(off) xlabel( 1 `" "Family & Friends" "only""' 2 `"+ neighbors"' 3 `" + civil society"', labsize(small) noticks) ///
       xtitle("Helper Groups") ytitle("Share of ppl. w. care responsibility") xtitle("") title(Care responsibility at home) scheme(lean2) name(A4, replace)
restore 

graph combine A1 A2 A3 A4,ycommon scheme(lean2) name(g2, replace) note(n=1172)
* Bar labels need to be added manually 

* Home office >> 32% family & Friends; 22% FF+ Neighbors; 30% All three groups (Read: Of those who received support from FF > 32% were in home office) 
tab home_office helper_groups, col nof
* Infection >> 3% FF; 6% FF+ N; 23% all three 
tab infection helper_groups, col nof
* Home child >> 19% FF; 23% FF+N; All three: 32%  
tab home_child helper_groups, col nof
* Home care >> FF only 6% ; FF+N 10%; All three: 15% 
tab home_care helper_groups, col nof




***********************************
* APPENDIX 1 
***********************************


* FIGURE A1.1 A
*From whom did people receive help? //// restricted to gethelp_2==1*
gen gethelp_fam_sh=gethelp_famfriends_r*100
gen gethelp_neigh_sh=gethelp_neighbor_r*100
gen gethelp_un_sh=gethelp_unknown_r*100
gen gethelp_org_sh=gethelp_orga_r*100
gen state_spprt_bi_sh=state_spprt_bi*100
graph bar gethelp_fam_sh gethelp_neigh_sh gethelp_un_sh gethelp_org_sh state_spprt_bi_sh if gethelp_2==1 [pweight=wgt_2], scheme(lean2) blabel(bar, format(%4.0f))  legend(position(6) col(3) bmargin(large)) legend(label(1 "from family & friends") label(2 "from neighbors") label(3 "from strangers") label(4 "from org.") label(5 "from state")) ytitle("percent")

* FIGURE A1.1 B // out of entire population*
graph bar gethelp_fam_sh gethelp_neigh_sh gethelp_un_sh gethelp_org_sh state_spprt_bi_sh [pweight=wgt_2], scheme(lean2) yscale(range(0 80)) ylabel(0(10)80) blabel(bar, format(%4.0f))  legend(position(6) col(3) bmargin(small)) legend(label(1 "from family & Friends") label(2 "from neighbors") label(3 "from strangers") label(4 "from org.") label(5 "from state")) ytitle("percent")


* FIGURE A1.2 A

*Types of help received// out of those who received some kind of help 
gen general_sh=gethelp_general_r*100
gen emo_sh=gethelp_emo_r*100
gen fin_sh=gethelp_fin_r*100
gen state_spprt_bi_sh=state_spprt_bi*100
***Restricted to those who received help// gethelp_2==1*
graph bar emo_sh general_sh fin_sh state_spprt_bi_sh if gethelp_2==1 [pweight=wgt_2], scheme(lean2) yscale(range(0(10)80)) ylabel(0(10)80) blabel(bar, format(%4.0f)) legend(position(6) col(3) bmargin(large)) legend(label(1 "Emotional Support") label(2 "General/ Practical Help") label(3 "Financial Help") label(4 "State Support")) ytitle("percent")

* FIGURE A1.2 B
* tyoes of help received out of entire population*
graph bar emo_sh general_sh fin_sh state_spprt_bi_sh [pweight=wgt_2], scheme(lean2) yscale(range(0(10)80)) ylabel(0(10)80) blabel(bar, format(%4.0f)) legend(position(6) col(3) bmargin(large)) legend(label(1 "Emotional Support") label(2 "General/ Practical Help") label(3 "Financial Help") label(4 "State Support")) ytitle("percent")


* Table A1.1
* Tabulations for Table 1 Appendix 2 // Exact numbers & percentages of different groups in Venn diagram 

net install venndiag
venndiag gethelp_famfriends_r gethelp_neighbor_r gethelp_civilsociety
venndiag gethelp_famfriends_r gethelp_neighbor_r gethelp_civilsociety if gethelp_2==1



// Table A1.2: Receiving support from different Helper groups 

logistic gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store gethelp 
logistic gethelp_famfriends_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store ff
logistic gethelp_neighbor_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store neighbors
logistic gethelp_civsoc_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store civsoc
logistic gethelp_unknown_2 c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store unknown
logistic gethelp_orga_2 c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store orga

esttab gethelp ff neighbors civsoc unknown orga, ci pr2 replace nogaps nobaselevels noconstant


// Figure A1.3: Coefficient plot of marginal effects // based on Model 1 from Table A1.2 

logistic gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post
coefplot, xline(0) levels(95) xlabel(, labsize(medsmall)) xtitle(Marginal effect on 'received support') ylabel(, labsize(small) val) title("Social Capital") keep(social_circle *.member trust_people) scheme(plotplainblind)  coeflabels(social_circle = "Social Circle" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(n=3330)


// Figure A1.4: Coefficient plot of marginal effects for Models 2,3,5,6 from Table A1.2 / showing strangers & orgas separately

logistic gethelp_famfriends_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store ff
logistic gethelp_neighbor_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store neighbor
logistic gethelp_unknown_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store unknown
logistic gethelp_orga_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store orga

coefplot ff neighbor unknown orga, xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) xtitle(Marginal effect on receiving support) title("Social Capital") keep(social_circle *.member trust_people) scheme(plotplainblind) coeflabels(social_circle = "Size of support network" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(n=1476)


// Figure A1.5: coefficient plot comparing civil society, strangers and organisations 


logistic gethelp_civsoc_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store civsoc
logistic gethelp_unknown_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store unknown
logistic gethelp_orga_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(_all) post
estimates store orga
coefplot civsoc unknown orga, xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) xtitle(Marginal effect on receiving support) title("Social Capital") keep(social_circle *.member trust_people) scheme(plotplainblind) coeflabels(social_circle = "Size of support network" 1.member="Orga Member" trust_people="Social Trust") name(A2, replace) note(n=1476)




// Table A1.3: Mutually exclusive helper groups 

logistic gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store gethelp
logistic ffonly i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store ffonly 
logistic ffandneighbors i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store ffandneighbors
logistic all i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store all
esttab gethelp ffonly ffandneighbors all, ci pr2 replace nogaps nobaselevels noconstant



// Table A1.4: Needed more support 

* Model A: uses family & friends, neighbors, civil society 
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store A
* Model B: Uses family & Friends, neighbours, strangers & organisations 
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_unknown_r i.gethelp_orga_r i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store B
esttab A B, ci pr2 replace nogaps nobaselevels noconstant

* Margins 
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_unknown_r i.gethelp_orga_r i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post


// Figure A1.6: Coefficient plot > needed more support > strangers and orgas separately 
logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_unknown i.gethelp_orga i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
margins, dydx(i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_unknown i.gethelp_orga) post
estimates store groups
coefplot groups, xline(0) xtitle(Marginal effect on receiving 'insufficient support', size(small)) note(n=1476) coeflabels(1.gethelp_famfriends_r = "Support from family & friends" 1.gethelp_neighbor_r = "Support from neighbours" 1.gethelp_unknown = "Support from strangers (informal civil society)" 1.gethelp_orga = "Support from organisation (formal civil society)")

logistic gethelp_more_bi_3 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_unknown i.gethelp_orga i.needed_state i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates table, star



// Table A1.5: Ordinal regression for "received support" > gethelp (Scale: 1-5) & "needed more support" (Scale: 1-4) 

* DV1 : Received support (1-5) 
ologit gethelp i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.social_circle i.member c.trust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store gethelp 

* DV2 : Needed more support  (1-4) 
ologit needed_more i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety  i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store needed_more

esttab gethelp needed_more, ci pr2 replace nogaps nobaselevels noconstant




// Figure A1.7 : Types of support by types of ties
 
gen gethelp_emo_sh=gethelp_emo_r*100
gen gethelp_general_sh=gethelp_general_r*100
gen gethelp_fin_sh=gethelp_fin_r*100
gen state_spprt_bi_sh=state_spprt_bi*100
graph bar gethelp_emo_sh gethelp_general_sh gethelp_fin_sh state_spprt_bi_sh if gethelp_2==1 [pweight=wgt_2], over(helper_groups)  scheme(lean2) blabel(bar, format(%4.0f) size(vsmall)) legend(position(6) col(3) bmargin(large)) legend(label (1 "Emotional Support") label(2 "General support") label(3 "Financial Support") label(4 "State Aid")) ytitle("percent")



// Table A1.6: Robustness Check 1// controlling for loneliness DV1 
logistic gethelp_2 c.lone_cmpny c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store gethelp 
logistic gethelp_famfriends_2 c.lone_cmpny c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store ff
logistic gethelp_neighbor_2 c.lone_cmpny c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store neighbors
logistic gethelp_civsoc_2 c.lone_cmpny c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store civsoc
logistic gethelp_more_bi_3 c.lone_cmpny i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety i.needed_state i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store more
esttab gethelp ff neighbors civsoc more, ci pr2 replace nogaps nobaselevels noconstant


// Table A1.7: Robustness Check 2// controlling for Big5
logistic gethelp_2 c.EmoStab c.Offenheit c.Verträglichkeit c.Extraversion c.Gewissenhaftigkeit c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store gethelp 
logistic gethelp_famfriends_2 c.EmoStab c.Offenheit c.Verträglichkeit c.Extraversion c.Gewissenhaftigkeit c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store ff
logistic gethelp_neighbor_2 c.EmoStab c.Offenheit c.Verträglichkeit c.Extraversion c.Gewissenhaftigkeit c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store neighbors
logistic gethelp_civsoc_2 c.EmoStab c.Offenheit c.Verträglichkeit c.Extraversion c.Gewissenhaftigkeit c.social_circle i.member c.trust_people i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store civsoc
logistic gethelp_more_bi_3 c.EmoStab c.Offenheit c.Verträglichkeit c.Extraversion c.Gewissenhaftigkeit i.gethelp_famfriends_r i.gethelp_neighbor_r i.gethelp_civilsociety i.needed_state i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2], or
estimates store more
esttab gethelp ff neighbors civsoc more, ci pr2 replace nogaps nobaselevels noconstant


// Table A1.8: Robustness Check 3// standardizing social capital IVs & using linear regression 
* (replication of Table A1.2)

*using standardized IVs: zsocial_circle & ztrust_people

regress gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store gethelp
regress gethelp_famfriends_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store ff
regress gethelp_neighbor_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store neighbor
regress gethelp_civsoc_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store civsoc
esttab gethelp ff neighbor civsoc, ci pr2 replace nogaps nobaselevels noconstant


// Figure A1.8 / based on Table A1.8
regress gethelp_famfriends_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates table, star 
margins, dydx(_all) post
estimates store ff
regress gethelp_neighbor_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates table, star 
margins, dydx(_all) post
estimates store neighbor
regress gethelp_civsoc_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates table, star 
margins, dydx(_all) post
estimates store civsoc
coefplot ff neighbor civsoc, xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) title("Social Capital (Standardized IVs)") keep(zsocial_circle *.member ztrust_people) scheme(plotplainblind) coeflabels(zsocial_circle = "Size of support network" 1.member="Orga Member" ztrust_people="Social Trust") name(A2, replace) note(n=1476)


// Table A1.9 // Also Robustness Check 3 // this time with mutually exclusive DVs 
* (replication of Table A1.3)
regress gethelp_2 i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store gethelp
regress ffonly i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store ffonly 
regress ffandneighbors i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store ffandneighbors
regress all i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store all
esttab gethelp ffonly ffandneighbors all, ci r2 replace nogaps nobaselevels noconstant


// Figure A1.9; Coefficient plot based on Table A1.9
regress ffonly i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post
estimates store ffonly
regress ffandneighbors i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
margins, dydx(_all) post
estimates store ff_neighbor
regress all i.gndr i.edu_lev2 i.age_level i.income_r i.income_chng_r c.zsocial_circle i.member c.ztrust_people i.infection i.home_office i.home_child i.home_care i.region i.east_de [pweight=wgt_2]
estimates store all
margins, dydx(_all) post
estimates store all_three
coefplot ffonly ff_neighbor all_three, xline(0) levels(95) xlabel(, labsize(medsmall)) ylabel(, labsize(small) val) title("Social Capital") keep(zsocial_circle *.member ztrust_people) scheme(plotplainblind)  coeflabels(zsocial_circle = "Size of support network" 1.member="Orga Member" ztrust_people="Social Trust") name(A2, replace)



**********************************
* SUMMARY STATISTICS FOR APPENDIX 2
***********************************

sum gethelp gethelp_2 gethelp_more gethelp_more_bi gethelp_famfriends_r gethelp_neighbor_r gethelp_civilsociety gethelp_unknown_r gethelp_orga_r

sum member social_circle trust_people 

sum infection home_office home_child home_care


*** Distributions of main independent & dependent variables 

* Figure A2.1
graph bar (count), over(gethelp) scheme(lean2) blabel(bar, format(%4.0f)) name(A1, replace) title("Original scale: Received support")
graph bar (count), over(gethelp_2) scheme(lean2) blabel(bar, format(%4.0f)) name(A2, replace) title("Recoded: Received support")
graph combine A1 A2,ycommon scheme(lean2) name(g2, replace) 

* Figure A2.2
graph bar (count), over(gethelp_more) scheme(lean2) blabel(bar, format(%4.0f)) name(A1, replace) title("Original scale: Needed more support")
graph bar (count), over(gethelp_more_bi) scheme(lean2) blabel(bar, format(%4.0f)) name(A2, replace) title("Recoded: Needed more support")
graph combine A1 A2,ycommon scheme(lean2) name(g2, replace) 

* Figure A2.3 
graph bar (count), over(social_circle) scheme(lean2) blabel(bar, format(%4.0f)) name(A1, replace) title("Size of support network")
graph bar (count), over(trust_people) scheme(lean2) blabel(bar, format(%4.0f)) name(A2, replace) title("Social trust")
graph bar (count), over(member) scheme(lean2) blabel(bar, format(%4.0f)) name(A3, replace) title("Organisational Membership")
graph combine A1 A2 A3,ycommon name(g2, replace) 







